import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 登录api接口集合
 * @method signIn 用户登录
 * @method signOut 用户退出登录
 */
export function houseApi() {
	return {

		//查询房间
		selectHousePage: (params?: object) => {
			return request({
				url: '/merchant/house/selectHousePage',
				method: 'get',
				params,
			});
		},

		//添加房间
		saveHouse: (data: object) => {
			return request({
				url: '/merchant/house/saveHouse',
				method: 'post',
				data,
			});
		},

		//修改房间
		updateHouse: (data: object) => {
			return request({
				url: '/merchant/house/updateHouse',
				method: 'post',
				data,
			});
		},

		//删除房间
		deleteHouse: (data: object) => {
			return request({
				url: '/merchant/house/deleteHouse',
				method: 'delete',
				data,
			});
		},

		// 获取房间类型
		getType: (params?: object) => {
			return request({
				url: '/merchant/foodtype/getFoodType',
				method: 'get',
				params,
			});
		},

		//查询房间图片
		getHouseImg: (params?: object) => {
			return request({
				url: '/merchant/image/selectHouseImg',
				method: 'get',
				params,
			});
		},

		//添加房间图片
		saveHouseImg: (data: object) => {
			return request({
				url: '/merchant/image/saveHouseImg',
				method: 'post',
				data,
			});
		},

		//删除房间图片
		deleteHouseImg: (data: object) => {
			return request({
				url: '/merchant/image/deleteHouseImg',
				method: 'delete',
				data,
			});
		},


	};
}
